package cs.sasu.service.Impl;

import cs.sasu.mapper.SystemMenuMapper;
import cs.sasu.pojo.SystemMenu;
import cs.sasu.service.SystemMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SystemMenuServiceImpl implements SystemMenuService {
    @Autowired
    private SystemMenuMapper systemMenuMapper;
    @Override
    public int save(SystemMenu menu) {
        try {
            return systemMenuMapper.save(menu);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public SystemMenu get(int i) {
        try {
            return systemMenuMapper.get(i);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public int update(SystemMenu menu) {
        try {
            return systemMenuMapper.update(menu);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public int delete(int i) {
        try {
            return systemMenuMapper.delete(i);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @Override
    public int remove(int i) {
        try {
            return systemMenuMapper.remove(i);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
